package com.jdbc;

import com.dao.Accountdao;
import com.domain.Account;
import com.service.Accountservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.stereotype.Component;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
@Component
public class jdbctemplate {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext(
                "spring.xml");
        Accountservice accountservice= (Accountservice) ac.getBean("accountservice");
        List<Account>list=accountservice.tran("aaa","bbb",1);
        for (Account a:list
             ) {
            System.out.println(a);
        }
    }
}
